Skip to content

Conversation

@andy-stark-redis
Copy link
Contributor

@andy-stark-redis andy-stark-redis commented Jan 16, 2025

DOC-4730

Summary:

  • The make.py file that builds the docs has a --stack option that specifies where to locate the index.json file for the client repos. Currently, we don't specify any option, so it uses the default.
  • I've added a new build target (localserve) that works the same as make serve but sets the --stack option of make.py to data/components_local/index.json instead of the default data/components/index.json. The data/components_local folder is just a copy of data/components to begin with, but you can change the individual client repo files (redis-py.json, etc) to reference your local clones of the repos instead of the ones on Github.
  • I've also added data/components_local to .gitignore.

The theory, then, is that you can keep the files in data/components_local permanently set to your local client repo clones (changing the branch when necessary) and build with them using make localserve. You won't commit this folder by mistake because it is in .gitignore.

Any suggestions for a better approach, better names, showstoppers, etc, are all very welcome :-)

@paoloredis
Copy link
Collaborator

Looks good, but in what scenario would you want to reference a local client repo (possibly outdated) instead of the latest github one?

@andy-stark-redis
Copy link
Contributor Author

Looks good, but in what scenario would you want to reference a local client repo (possibly outdated) instead of the latest github one?

@paoloredis When you're developing a code example, you use your local clone of the client repo before eventually submitting the PR, as usual. However, it's best if you test the content of the example in-page by doing a docs build (to check for bad formatting, etc).

By default, the docs build references the Github versions of the client repos rather than your local clones. You can change the locations in the docs repo config to reference your local clones, but then you have to change them back periodically or avoid adding the changes when you do git add. The new build target seems like a handy way to access your local client repo clones during development without messing up the defaults we use for the "proper" build.

Copy link
Collaborator

@dwdougherty dwdougherty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice QOL improvement! Thanks, @andy-stark-redis. Approved.

@andy-stark-redis
Copy link
Contributor Author

Cheers, @dwdougherty and @paoloredis !

@andy-stark-redis andy-stark-redis merged commit d2abfe5 into main Jan 16, 2025
4 checks passed
@andy-stark-redis andy-stark-redis deleted the DOC-4730-local-code-repo-build-target branch January 16, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants